package com.shiguiwu.springmybatis.spring.aop.aspect;

import org.springframework.aop.aspectj.annotation.AspectJProxyFactory;

/**
 * @description: 测试
 * @author: stone
 * @date: Created by 2021/6/10 10:27
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.aop.aspect
 */
public class AspectTests {

    public static void main(String[] args) {
        AspectJProxyFactory proxyFactory = new AspectJProxyFactory();
        AspectService target = new AspectService();
        //设置目标对象
        proxyFactory.setTarget(target);
        //添加切面
        proxyFactory.addAspect(MyAspect.class);

        AspectService proxy = proxyFactory.getProxy();
        proxy.m1();
        proxy.m2();

    }
}
